﻿<%@ Page Title="" Language="VB" MasterPageFile="~/App/Master/App.master" AutoEventWireup="false" CodeFile="Schedule.aspx.vb" Inherits="App_Schedule" %>


<asp:Content ID="Content1" ContentPlaceHolderID="CphHead" runat="Server">
    <link href="/js/ajaxuploader/fileuploader.css" rel="stylesheet" type="text/css" />
    <style>
        input[type="checkbox"] {
            /*display: block;*/
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="CphMainContent" runat="Server">
    <asp:ScriptManagerProxy runat="server">
        <Scripts>
            <asp:ScriptReference Path="~/js/ajaxuploader/fileuploader.js" />
        </Scripts>
    </asp:ScriptManagerProxy>


    <script type="text/javascript">


        $(function () {

            $.mask.definitions = {
                '9': "[0-9]",
                'a': "[A-Za-z]",
                '*': "[A-Za-z0-9]",
                'h': "[0-2]",
                'm': "[0-5]"
            };

            SetUI();
            on_update_panel_server(function () {
                SetUI();

            });



        });


        function SetUI() {



            $("#TxtBeginDate").datepicker({
                dateFormat: 'yy-mm-dd'
            });


            $('#TxtRepeatFromTime,#TxtRepeatToTime,#TxtRepeatEveryTime').mask("h9:m9", {
                placeholder: "0"
            });

            autoaccount('#TxtAccountName', '#HidAccountId');
            //alert('i');
            $(".chosen-select").chosen({
                width: "250px"
            });

            $("#TxtBeginDate").datepicker({
                dateFormat: 'yy-mm-dd',
                defaultDate: "+1w",
                changeMonth: true,
                numberOfMonths: 1,
                onClose: function (selectedDate) {
                    $("#TxtEndDate").datepicker("option", "minDate", selectedDate);
                }
            });
            $("#TxtEndDate").datepicker({
                dateFormat: 'yy-mm-dd',
                defaultDate: "+1w",
                changeMonth: true,
                numberOfMonths: 1,
                onClose: function (selectedDate) {
                    $("#TxtBeginDate").datepicker("option", "maxDate", selectedDate);
                }
            });


        }



        function autoaccount(l, h) {
            //var last_search = '';
            //$('#HidMainSearchSel').val('');

            $.ui.autocomplete.prototype._renderItem = function (ul, item) {
                var re = new RegExp("\\b" + this.term, "ig");
                var t = item.label.replace(re, "<span style='font-weight:bold;color:Red;'>$&</span>");
                return $("<li></li>")
                    .data("item.autocomplete", item)
                    .append("<a>" + t + "</a>")
                    .appendTo(ul);
            };

            $.widget("custom.catcomplete", $.ui.autocomplete, {
                _renderMenu: function (ul, items) {
                    var self = this,
				                currentCategory = "";
                    $.each(items, function (index, item) {
                        if (item.category != currentCategory) {
                            ul.append("<li class='ui-autocomplete-category'>" + item.category + "</li>");
                            currentCategory = item.category;
                        }
                        self._renderItem(ul, item);
                    });
                }
            });



            $(l).catcomplete({
                source: function (request, response) {
                    $.ajax({
                        url: "/webservice/account.asmx/AutoCompleteAccount",
                        type: "POST",
                        contentType: "application/json; charset=utf-8",
                        dataType: "json",
                        data: '{"k":"' + request.term + '","c":"' + '1' + '"}',
                        success: function (data) {
                            response(data.d);
                            //alert('fine'); 
                        },
                    });
                },
                minLength: 2,
                delay: 100,
                search: function (event, ui) {
                    //alert(countryid);
                },
                select: function (event, ui) {
                    //alert(ui.item.id);
                    $(h).val(ui.item.id);
                    //$('#BtnMainSearch').click();
                    //__doPostBack(SearchButtonName,'');

                }
            });

        }

    </script>


    <!-- wizard / edit -->
    <div class="row-fluid">
        <!-- Task -->
        <asp:UpdatePanel runat="server" ID="UpPTaskEdit" UpdateMode="Conditional" class="schedule-wizard">
            <ContentTemplate>
                <!-- titolo -->
                <div class="top-bar-wizard">
                    <div class="schedule-top-title">add a new schedule wizard</div>
                    <div class="schedule-step">step 1</div>
                    <div id="read" class="schedule-read">
                        <div>
                            <input id="c1" type="checkbox" name="c1">
                            <label for="c1">
                                <span></span>
                                I’ve read and agreed Twitter rules about auto posting
                            </label>
                        </div>
                    </div>
                    <div class="schedule-icona"><a href="#" class="a-icona7-b"></a></div>
                </div>
                <!-- wizard step 1 -->
                <asp:Panel runat="server" ID="PnlTaskEditWiz1" class="well-schedule-wizard">
                    <div class="social-schedule-head">
                        Write a name for this schedule
                    </div>
                    <div class="schedule-input-serach">
                        <asp:TextBox runat="server" ID="TxtDescription" placeholder="e.g. Tweets from my blog posts"></asp:TextBox>
                        <asp:Label runat="server" ID="lll" Text="Dato mancante" Visible="false" ViewStateMode="Disabled"></asp:Label>
                        <asp:HiddenField runat="server" ID="HidTaskId" />
                    </div>
                    <div style="float:left;width:100%">
                        <asp:TextBox runat="server" ID="TxTNextHours" text="1,4,12"></asp:TextBox>
                        <asp:LinkButton runat="server" ID="BtnAddNexThours" class="bottone-engage-save">Add Sched</asp:LinkButton>
                    </div>
                    <div class="schedule-wizard-body">
                        <!-- task schedule add -->
                        <asp:Label runat="server" ID="LblErrSchedule" Text="Inserire uno schedule" Visible="false" ViewStateMode="Disabled"></asp:Label>
                        <asp:Panel runat="server" ID="PnlTaskShedAdd" Visible="true" CssClass="schedule-wizard-body-add">
                            <div class="schedule-wizard-body-add-message">
                                Add one or more time schedules:
                            </div>
                            <div class="schedule-wizard-body-add-tasto">
                                <asp:LinkButton runat="server" ID="BtnTaskSchedAdd" CssClass="a-icona-add"></asp:LinkButton>
                            </div>
                        </asp:Panel>
                        <!-- task schedule edit -->
                        <asp:Panel runat="server" ID="PnlTaskShedEdit" Visible="false" CssClass="schedule-wizard-body-add">
                            <asp:ListView runat="server" ID="ListTaskShedEdit">
                                <ItemTemplate>
                                    <div class="schedule-wizard-body-add-message">
                                        Add one or more time schedules:
                                    </div>
                                    <div class="schedule-wizard-start-at">
                                        <div class="schedule-wizard-start-at-starting">
                                            starting
                                    <asp:TextBox runat="server" ID="TxtBeginDate" Text='<%# CurrAccount.Print.DateInput(Eval("begin_date"))%>'></asp:TextBox>
                                        </div>
                                        <div class="schedule-wizard-start-at-at">
                                            at
                                    <asp:TextBox runat="server" ID="TxtRepeatFromTime" Text='<%# CurrAccount.Print.TimeShort(Eval("begin_date"))%>'></asp:TextBox>
                                        </div>
                                        <div class="schedule-wizard-start-at-label">
                                            <input id="c2" type="checkbox" name="c2">
                                            <label for="c2">
                                                <span></span>
                                                exact time
                                            </label>
                                        </div>
                                    </div>
                                    <div class="schedule-wizard-start-to">
                                        <div class="schedule-wizard-start-to-label">
                                            <asp:CheckBox runat="server" ID="ChkRangeTime" Checked='<%# eval("range_time") %>' OnCheckedChanged="ChkRangeTime_Checked" AutoPostBack="false" />
                                            <label for="ChkRangeTime">
                                                <span></span>
                                            </label>
                                        </div>
                                        <div class="schedule-wizard-start-to-to">
                                            to
                                        <asp:TextBox runat="server" ID="TxtRepeatToTime" Text='<%# Eval("repeat_to_time")%>'></asp:TextBox>
                                        </div>
                                        <div class="schedule-wizard-start-to-every">
                                            every
                                        <asp:TextBox runat="server" ID="TxtRepeatEveryTime" Text='<%# eval("repeat_every_time") %>'></asp:TextBox>
                                        </div>
                                    </div>
                                    <div class="schedule-wizard-start-repeat">
                                        <div class="schedule-wizard-start-to-label">
                                            <asp:CheckBox runat="server" ID="ChkEveryDay" Checked='<%# Eval("repeat_day")%>' OnCheckedChanged="ChkEveryDay_Checked" AutoPostBack="false" />
                                            <label for="ChkEveryDay">
                                                <span></span>
                                            </label>
                                        </div>
                                        <div class="schedule-wizard-start-repeat-until">
                                            repeat until
                                        <asp:TextBox runat="server" ID="TxtEndDate" Text='<%# CurrAccount.Print.DateInput(Eval("end_date"))%>' Width="60px"></asp:TextBox>
                                        </div>
                                    </div>
                                    <div class="schedule-wizard-start-week">
                                        <ul>
                                            <asp:ListView runat="server" ID="ListRepeatDay" DataSource='<%# Eval("repeat_day_week")%>' ClientIDMode="Predictable" DataKeyNames="key">
                                                <ItemTemplate>
                                                    <%--<asp:CheckBox runat="server" Style="display: inline-block;" ID="ChkRepeatDay" Checked='<%# CBool(Eval("value"))%>' Text='<%#MyUI.Print.DayWeek(Eval("key"))%>' TextAlign="Right" />--%>
                                                    <li>

                                                        <asp:CheckBox runat="server" ID="ChkRepeatDay" Checked='<%# CBool(Eval("value"))%>' />
                                                        <label for='<%# UI.ListDataItem.GetCheckBox(Container, "ChkRepeatDay").ClientID%>'>
                                                            <span></span>
                                                            <%#CurrAccount.Print.DayWeek(Eval("key")).Substring(0, 1)%>
                                                        </label>

                                                    </li>
                                                </ItemTemplate>
                                            </asp:ListView>



                                        </ul>
                                        <asp:LinkButton runat="server" CommandName="UPDATE_ROW" CssClass="a-schedule-save" />
                                    </div>
                                </ItemTemplate>
                            </asp:ListView>
                        </asp:Panel>
                        <!-- task schedule list -->
                        <div class="schedule-wizard-body-act">
                            <asp:ListView runat="server" ID="ListTaskShed" ClientIDMode="Predictable">
                                <ItemTemplate>
                                    <div class="schedule-wizard-body-scheda">
                                        <div class="schedule-scheda-at">
                                            starting <%# CurrAccount.Print.DateTimeLong(Eval("begin_date"))%>
                                        </div>
                                        <asp:Panel runat="server" Visible='<%# eval("range_time") %>' class="schedule-scheda-to">
                                            to <%# Eval("repeat_to_time")%> every <%# eval("repeat_every_time") %>
                                        </asp:Panel>
                                        <asp:Panel runat="server" Visible='<%# Eval("repeat_day")%>' CssClass="schedule-scheda-active">
                                            active <%# CurrAccount.Print.DaysWeekShort(Eval("repeat_day_week"))%>
                                        </asp:Panel>
                                        <div class="schedule-scheda-until">
                                            <%--<asp:Panel runat="server" Visible='<%# Eval("repeat_day")%>' >--%>
                                            <asp:Label runat="server" Visible='<%# Eval("repeat_day")%>'>until <%# CurrAccount.Print.DateLong(Eval("end_date"))%></asp:Label>
                                            <%--</asp:Panel>--%>
                                            <div class="schedule-scheda-ico">
                                                <asp:LinkButton runat="server" CssClass="a-icona-matita" CommandName="EDIT_ROW"></asp:LinkButton>
                                                <asp:Button runat="server" CssClass="a-icona-x" OnClientClick="return openconfirm(this);" CommandName="DELETE_ROW"></asp:Button>
                                            </div>
                                        </div>
                                    </div>
                                </ItemTemplate>
                            </asp:ListView>
                            <div class="schedule-footer" style="z-index: 1000; display: none;">
                                <App:DataPager runat="server" Controlid="ListTaskShed" PageSize="3" OnPageChanged="SetListTakSched" />
                            </div>

                        </div>
                        <!-- next button -->
                        <div class="schedule-wizard-body-choose">
                            <div class="schedule-wizard-body-choose-message">
                                now choose what to share
                            </div>
                            <div class="schedule-wizard-body-choose-arrow">
                                <asp:LinkButton runat="server" ID="BtnTaskEditNext" CssClass="a-insert-hashtags"></asp:LinkButton>
                            </div>
                        </div>
                    </div>
                    <div class="schedule-wizard-post-day">
                        <div>
                            <asp:CheckBox runat="server" ID="ChkEnabledTask" />
                            <label for="ChkEnabledTask">
                                <span></span>
                                Attivato
                            </label>
                            <asp:CheckBox runat="server" ID="ChkRepeatSendPost" />
                            <label for="ChkRepeatSendPost">
                                <span></span>
                                Ripeti invio post
                            </label>
                        </div>
                        <div class="search-text">You can set a post-per-day limit (0 = infinite) </div>
                        <div class="schedule-input-set">
                            <asp:TextBox runat="server" ID="TxtSendMaxDay" Width="20" placeholder="0"></asp:TextBox>
                        </div>


                        <%--                        <div class="schedule-wizard-engage-import">
                            <a class="bottone-engage-import" href="#">import</a>
                        </div>--%>
                    </div>
                    <div class="social-schedule-search">
                        <div class="schedule-scheda-ico">
                            <asp:LinkButton runat="server" ID="BtnTaskEditClose" CssClass="a-schedule-x" title="Nel titolo il testo toltip"></asp:LinkButton>
                        </div>
                        <div class="schedule-wizard-engage-save">
                            <asp:LinkButton runat="server" ID="BtnTaskEditSaveClose" class="bottone-engage-save">Save and close</asp:LinkButton>
                        </div>
                    </div>
                </asp:Panel>
                <!-- wizard step 2 -->
                <asp:Panel runat="server" ID="PnlTaskEditWiz2" CssClass="well-schedule-wizard" Visible="false">
                    <div class="schedule-wizard-body-choose-arrow-sx">
                        <asp:LinkButton runat="server" ID="BtnTaskEditPrev" CssClass="a-insert-arrow-sx"></asp:LinkButton>
                    </div>
                    <div class="schedule-wizard-tab">
                        <!-- menu typi -->
                        <ul class="schedule-wizard-tab-links">
                            <asp:ListView runat="server" ID="ListTaskType">
                                <ItemTemplate>
                                    <li class="<%# IIf(Eval("select"), "active", "")%>">
                                        <asp:LinkButton runat="server" CssClass='<%# eval("css") %>'><%# eval("text") %></asp:LinkButton>
                                    </li>
                                </ItemTemplate>
                            </asp:ListView>
                        </ul>
                        <!-- tweet -->
                        <asp:Panel runat="server" ID="PnlTaskType1" CssClass="schedule-wizard-content" Visible="false">
                            <div class="a-schedule-text"></div>
                            <div class="a-schedule-text-zone">
                                <%--<textarea class="schedule-text-area" name="tweet" placeholder="write here you message"></textarea>--%>
                                <asp:TextBox runat="server" ID="TxtListpost" TextMode="MultiLine" placeholder="write here you message" CssClass="schedule-text-area"></asp:TextBox>

                            </div>
                            <div class="schedule-wizard-tweet-upload" style="display: none;">
                                <a href="#" class="a-schedule-up"></a>
                            </div>
                            <div class="schedule-wizard-tweet-xml" style="display: none;">
                                <a class="bottone-save" href="#">xml upload</a>
                            </div>
                            <div class="schedule-wizard-tweet-user" style="display: none;">
                                pippo.jpg<a class="a-icona-x tooltip" href="#" title="Tips Icon"></a>
                            </div>
                            <div class="schedule-wizard-engage-import">
                                <asp:LinkButton runat="server" ID="BtnAddMultiPosts" Text="import" CssClass="bottone-engage-import" />
                            </div>

                        </asp:Panel>
                        <!-- share -->
                        <asp:Panel runat="server" ID="PnlTaskType2" CssClass="schedule-wizard-content" Visible="false">
                            <div class="schedule-wizard-share-tweet">
                                <div class="schedule-wizard-share-tweet-chioc">
                                    <span class="a-chiocc"></span>
                                </div>
                                <div class="schedule-wizard-share-tweet-text">
                                    <asp:TextBox runat="server" ID="TxtShareAccountUsername" placeholder="the Twitter account you wish to retweet"></asp:TextBox>
                                </div>
                                <div class="schedule-wizard-share-tweet-ret">
                                    <asp:CheckBox runat="server" ID="ChkShareAllPost" />
                                    <label for="ChkShareAllPost">
                                        <span></span>
                                        retweet all posts
                                    </label>
                                </div>
                            </div>
                            <div class="schedule-wizard-share-body">
                                <asp:ListView runat="server" ID="ListAccountShare">
                                    <ItemTemplate>


                                        <div class="icona-foto-mention">
                                            <img src="<%# eval("avatar") %>" style="width: 40px;" />
                                        </div>
                                        <div class="content-mention">
                                            <div class="testo-mention">
                                                <div class="schedule-wizard-share-body-user">
                                                    <asp:HyperLink runat="server" NavigateUrl='<%# "https://twitter.com/" & eval("username") %>' Target="_blank">
                                                        @<%# Eval("username")%>
                                                    </asp:HyperLink>
                                                </div>
                                                <%# eval("description") %>
                                            </div>
                                        </div>
                                        <div class="counter-tweet">
                                            <div class="count">
                                                <div class="counter-n"><%# eval("Post_Count") %></div>
                                                <div class="counter-t">TWEETS</div>
                                            </div>
                                            <div class="count">
                                                <div class="counter-n"><%# eval("Friend_Count") %>'</div>
                                                <div class="counter-t">FOLLOWING</div>
                                            </div>
                                            <div class="count">
                                                <div class="counter-n"><%# Eval("Follower_Count")%>'</div>
                                                <div class="counter-t">FOLLOWERS</div>
                                            </div>
                                        </div>
                                    </ItemTemplate>
                                </asp:ListView>
                                <div class="schedule-scheda-ico">
                                    <asp:LinkButton runat="server" ID="BtnRemoveAccount" CssClass="a-schedule-x" title="Nel titolo il testo toltip"></asp:LinkButton>
                                </div>

                            </div>
                            <div class="schedule-wizard-share-rss-tweet" style="display: none;">
                                <div class="schedule-wizard-share-tweet-rss">
                                    <a class="a-rss" href="#"></a>
                                </div>
                                <div class="schedule-wizard-share-tweet-rss-text">
                                    <input id="Text2" type="text" placeholder="the Twitter account you wish to retweet" name="search">
                                </div>
                            </div>
                            <div class="schedule-wizard-share-rss" style="display: none;">
                                <div class="schedule-wizard-share-body-rss">
                                    <div class="share-feed-title">
                                        Feed title
                                    </div>
                                    <div class="share-feed-link">
                                        View feed link
                                    </div>
                                    <div class="schedule-scheda-ico">
                                        <a class="a-schedule-x" title="Nel titolo il testo toltip" href="#"></a>
                                    </div>
                                </div>
                            </div>

                            <div class="schedule-wizard-engage-import">
                                <asp:LinkButton runat="server" ID="BtnNewAccount" CssClass="bottone-engage-import">add</asp:LinkButton>
                            </div>
                        </asp:Panel>
                        <!-- engage -->
                        <asp:Panel runat="server" ID="PnlTaskType3" CssClass="schedule-wizard-content" Visible="false">
                            <div class="schedule-wizard-engage-select">
                                Who to engage
                                <asp:DropDownList ID="DdlAutoPostLinkTypeId" runat="server">
                                </asp:DropDownList>

                            </div>
                            <div class="schedule-wizard-engage-language">
                                Language
                                <asp:ListBox multiple="" runat="server" CssClass="chosen-select" Width="200px" ID="DdlAutoPostLanguage" SelectionMode="Multiple" />

                            </div>
                            <div class="schedule-wizard-engage-exclude">
                                Exclude language
                                <asp:ListBox multiple="" runat="server" CssClass="chosen-select" Width="200px" ID="DdlAutoPostLanguageNot" SelectionMode="Multiple" />
                            </div>
                            <div class="message-check">
                                <asp:CheckBox runat="server" ID="ChkAutoPostPrivate" />
                                <label for="ChkAutoPostPrivate">
                                    <span></span>
                                    private message
                                </label>
                            </div>
                            <div class="message-absolute">
                                <div class="listen-testo">
                                    <asp:TextBox runat="server" ID="TxtAutoPostText1" class="listen-text" placeholder="write your message" TextMode="MultiLine"></asp:TextBox>
                                </div>
                            </div>
                            <div class="message-absolute">
                                <div class="listen-testo">
                                    <asp:TextBox runat="server" ID="TxtAutoPostText2" class="listen-text" placeholder="write your message" TextMode="MultiLine"></asp:TextBox>
                                </div>
                            </div>
                            <div class="message-absolute">
                                <div class="listen-testo">
                                    <asp:TextBox runat="server" ID="TxtAutoPostText3" class="listen-text" placeholder="write your message" TextMode="MultiLine"></asp:TextBox>
                                </div>
                            </div>
                            <div class="message-absolute">
                                <div class="listen-testo">
                                    <asp:TextBox runat="server" ID="TxtAutoPostText4" class="listen-text" placeholder="write your message" TextMode="MultiLine"></asp:TextBox>
                                </div>
                            </div>
                            <div class="message-absolute">
                                <div class="listen-testo">
                                    <asp:TextBox runat="server" ID="TxtAutoPostText5" class="listen-text" placeholder="write your message" TextMode="MultiLine"></asp:TextBox>
                                </div>
                            </div>

                            <div class="schedule-wizard-engage-code">
                                {username} {fullname} {location} {url} {post;[time]} {followers;[time]} 							{friends;[time]} {male_perc} {female_perc} {business_perc} {most_engaging;[time]} {last_followers;[time]} time = d = day | w = week | m = month 
                            </div>
                        </asp:Panel>
                        <!-- connect -->
                        <asp:Panel runat="server" ID="PnlTaskType4" CssClass="schedule-wizard-content" Visible="false">

                            <App:PostWrite runat="server" ID="CtrListPost" Title="" EnabledToAccount="false" EnabledPrivate="true" EnabledSendPost="false" />

                            <div class="schedule-wizard-engage-code">
                                {username} {fullname} {location} {url} {post} {followers} {friends}
                            </div>
                            <div class="always-connection" style="display: none;">

                                <ul>
                                    <li>
                                        <div><a href="#" class="pg-count">always</a></div>
                                    </li>
                                    <li>
                                        <div><a href="#" class="pg-count">15</a></div>
                                    </li>
                                    <li><span><a href="#" class="pg-count-h">30</a></span></li>
                                    <li><span><a href="#" class="pg-count">60</a></span></li>
                                    <li><span><a href="#" class="pg-count">90</a></span></li>
                                    <li>
                                        <span><a href="#" class="a-schedule-connect-add"></a></span>
                                    </li>

                                </ul>
                            </div>
                            <div class="schedule-wizard-engage-name">
                                <%--                                <div>
                                    <div class="schedule-wizard-engage-user">user name</div>
                                    <input id="textfield2" type="text" value="#" name="textfield2">
                                </div>
                                <div>
                                    <div class="schedule-wizard-engage-full">full name</div>
                                    <input id="textfield3" type="text" value="#" name="textfield3">
                                </div>--%>
                                <div>
                                    <div class="schedule-wizard-engage-user">from</div>
                                    <asp:TextBox runat="server" ID="TxtBeginDate" CssClass=""></asp:TextBox>
                                </div>
                                <div>
                                    <div class="schedule-wizard-engage-user">to</div>
                                    <asp:TextBox runat="server" ID="TxtEndDate" CssClass=""></asp:TextBox>
                                </div>

                                <div>
                                    <div class="schedule-wizard-engage-user">link</div>
                                    <asp:ListBox multiple="" runat="server" CssClass="chosen-select" ID="DdlLinkType" SelectionMode="Multiple" />
                                </div>
                                <div>
                                    <div class="schedule-wizard-engage-user">categoria</div>
                                    <asp:ListBox multiple="" runat="server" CssClass="chosen-select" ID="DdlCategories" SelectionMode="Multiple" />

                                </div>
                                <div>
                                    <div class="schedule-wizard-engage-user">not categoria</div>
                                    <asp:ListBox multiple="" runat="server" CssClass="chosen-select" ID="DdlCategoriesNot" SelectionMode="Multiple" />

                                </div>
                                <div>
                                    <div class="schedule-wizard-engage-user">gender</div>
                                    <asp:ListBox multiple="" runat="server" CssClass="chosen-select" ID="DdlGender" SelectionMode="Multiple" />
                                </div>
                                <div>
                                    <div class="schedule-wizard-engage-user">business</div>
                                    <asp:ListBox multiple="" runat="server" CssClass="chosen-select" ID="DdlBusiness" SelectionMode="Multiple" />
                                </div>
                                <div>
                                    <div class="schedule-wizard-engage-user">language</div>
                                    <asp:ListBox multiple="" runat="server" CssClass="chosen-select" ID="DdlLanguage" SelectionMode="Multiple" />
                                </div>
                                <div>
                                    <div class="schedule-wizard-engage-user">not language</div>
                                    <asp:ListBox multiple="" runat="server" CssClass="chosen-select" ID="DdlLanguageNot" SelectionMode="Multiple" />
                                </div>
                                <div>
                                    <div class="schedule-wizard-engage-user">status</div>
                                    <asp:ListBox multiple="" runat="server" CssClass="chosen-select" ID="DdlStatus" SelectionMode="Multiple" />
                                </div>



                            </div>
                            <div class="schedule-wizard-engage-import">
                                <asp:LinkButton runat="server" ID="BtnAddListPosts" CssClass="bottone-engage-import">import</asp:LinkButton>
                            </div>
                        </asp:Panel>
                    </div>
                    <div class="schedule-wizard-body-choose">
                        <div class="schedule-wizard-body-choose-save">save </div>
                        <div class="schedule-wizard-body-choose-arrow-save">
                            <a class="a-wizard-save" href="#"></a>
                        </div>
                    </div>
                    <%--                    <div class="schedule-wizard-post-day">
                        <div class="schedule-wizard-engage-import">
                            <a class="bottone-engage-import" href="#">import</a>
                        </div>
                    </div>--%>
                    <div class="social-schedule-search">
                        <div class="schedule-scheda-ico">
                            <asp:LinkButton runat="server" ID="BtnTaskEditClose2" CssClass="a-schedule-x" title="Nel titolo il testo toltip"></asp:LinkButton>
                        </div>
                        <div class="schedule-wizard-engage-save">
                            <asp:LinkButton runat="server" ID="BtnTaskEditSaveClose2" class="bottone-engage-save">Save and close</asp:LinkButton>
                        </div>
                    </div>
                </asp:Panel>

                <!-- fine contenuti -->
            </ContentTemplate>
        </asp:UpdatePanel>
        <!-- fine box 1 -->
    </div>

    <!-- queue -->
    <div class="row-fluid">
        <!-- list post -->
        <asp:UpdatePanel ID="UpPTaskPost" runat="server" UpdateMode="Conditional">
            <ContentTemplate>

                <asp:Panel runat="server" ID="PnlTaskPost" CssClass="queue" Visible="false">
                    <!-- titolo -->
                    <div class="top-bar">
                        queue
                <div>
                    <a href="#" class="a-icona7 tooltip" title="Nel titolo il testo toltip"></a>
                </div>
                    </div>
                    <!-- contenuto -->
                    <div class="well-queue">



                        <div class="well-queue-head">
                            <ul>
                                <li>
                                    <asp:LinkButton runat="server" ID="BtnNewPost" CssClass="bottone-queue-head">ADD</asp:LinkButton>
                                </li>
                                <li>
                                    <asp:LinkButton runat="server" ID="BtnResetPosts" CssClass="bottone-queue-head">RESET QUEUE</asp:LinkButton>
                                </li>
                                <li>
                                    <asp:LinkButton runat="server" ID="BtnRandomizePosts" CssClass="bottone-queue-head">RANDOMIZE</asp:LinkButton>
                                </li>
                                <li>
                                    <asp:LinkButton runat="server" ID="BtnDeleteAllPosts" CssClass="bottone-queue-head">DELETE EVERYTHING</asp:LinkButton>
                                </li>
                            </ul>
                            <div class="queue-search">
                                <input id="place" type="text" placeholder="look for something inside the queue" name="search">
                                <button class="submit" type="submit">Search</button>
                            </div>
                        </div>
                        <div class="queue-send-only">
                            <asp:CheckBox runat="server" ID="ChkViewOnlyToSend" AutoPostBack="true" />
                            <label for="ChkViewOnlyToSend">
                                <span></span>
                                to be sent only
                            </label>
                        </div>
                        <div class="well-queue-body">
                            <div class="queue-head">
                                <div class="queue-head-dm"></div>
                                <div class="queue-head-post">post </div>
                                <div class="queue-head-sent">sent </div>
                                <div class="queue-head-last">last sending / errors </div>
                                <div class="queue-head-move"></div>
                                <div class="queue-head-ico"></div>
                            </div>
                            <asp:ListView runat="server" ID="ListTaskPost" ClientIDMode="Predictable">

                                <ItemTemplate>

                                    <div class="queue-row">
                                        <div class="queue-row-dm">
                                            <asp:Label runat="server" Visible='<%# eval("Post_Type_Id") = 1 %>' Text='DM'></asp:Label>
                                            <asp:Label runat="server" Visible='<%# eval("Post_Type_Id") = 2 %>' ForeColor="Red" Font-Size="10px" Text='(share)'></asp:Label>
                                        </div>
                                        <div class="queue-row-post">
                                            <asp:Label runat="server" CssClass="schedule-user" Visible='<%# eval("To_Account_Username") <> "" %>' Text='<%# "@" & eval("To_Account_Username") %>'></asp:Label>
                                            <%# MyUI.Print .Post(eval("post_text")) %>
                                            <asp:Image runat="server" ID="ImgPost" ImageUrl='<%# "~/app/Mediaupload.aspx?id=" & Eval("media_id") %>' Style="max-height: 100px; max-width: 100px" Visible='<%# CBool(Eval("media_id") <> 0)%>' />

                                        </div>
                                        <div class="queue-row-sent">
                                            <div runat="server" visible='<%# eval("send_post") %>' class="spunta"></div>
                                        </div>
                                        <div class="queue-row-last">
                                            <div class="queue-row-last-data"><%# CurrAccount.Print.DateTimeShort(Eval("last_send_date"))%></div>
                                            <div class="schedule-row-nessage"><%# eval("last_send_result") %></div>
                                        </div>
                                        <div class="queue-row-move">
                                            <asp:LinkButton runat="server" CommandName="MOVE_BEGIN" CssClass="bottone-queue-move">first</asp:LinkButton>
                                            <asp:LinkButton runat="server" CommandName="MOVE_PREV" CssClass="bottone-queue-move">up</asp:LinkButton>
                                            <asp:LinkButton runat="server" CommandName="MOVE_END" CssClass="bottone-queue-move">last</asp:LinkButton>
                                            <asp:LinkButton runat="server" CommandName="MOVE_NEXT" CssClass="bottone-queue-move">down</asp:LinkButton>
                                        </div>
                                        <div class="queue-row-ico">
                                            <div class="schedule-scheda-ico">
                                                <asp:LinkButton runat="server" Visible='<%# eval("Post_Type_Id") <> 2 %>' CommandName="EDIT_ROW" CssClass="a-icona-matita"></asp:LinkButton>
                                                <asp:LinkButton runat="server" CommandName="DELETE_ROW" CssClass="a-icona-x"></asp:LinkButton>
                                            </div>
                                        </div>
                                    </div>
                                </ItemTemplate>
                                <EditItemTemplate>

                                    <div class="queue-row-dm">
                                    </div>
                                    <div class="queue-row-post">
                                        <App:PostWrite runat="server" ID="CtrPost" AutoLoad="true" EnabledToAccount="true" EnabledPrivate="true" EnabledSendPost="false" MediaID='<%# eval("media_id") %>' PostText='<%# eval("post_text") %>' PrivatePost='<%# eval("Post_Type_Id") %>' ToAccount='<%# eval("To_Account_Username") %>' />

                                    </div>
                                    <div class="queue-row-sent">
                                        <asp:CheckBox runat="server" ID="ChkSendPost" Text="" Checked='<%# eval("send_post") %>' TextAlign="Left" />
                                        <label for='<%# UI.ListDataItem.GetCheckBox(Container, "ChkSendPost").ClientID%>'>
                                            <span></span>
                                        </label>
                                    </div>
                                    <div class="queue-row-last">
                                    </div>
                                    <div class="queue-row-move">
                                    </div>
                                    <div class="queue-row-ico">
                                        <asp:LinkButton runat="server" CommandName="UPDATE_ROW" CssClass="a-icona-disco"></asp:LinkButton>
                                        <asp:LinkButton runat="server" CommandName="CANCEL_ROW_EDIT" CssClass="a-icona-x"></asp:LinkButton>

                                    </div>




                                </EditItemTemplate>
                            </asp:ListView>
                        </div>
                    </div>
                    <div class="queue-footer">
                        <App:DataPager runat="server" Controlid="ListTaskPost" PageSize="15" OnPageChanged="SetListTaskPost" />


                    </div>
                </asp:Panel>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>

    <!-- task list -->
    <div class="row-fluid">
        <asp:UpdatePanel ID="UpPTaskList" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <!-- task list -->
                <div class="schedule">
                    <!-- titolo -->
                    <div class="top-bar">
                        schedules
                        <div>
                            <a href="#" class="a-icona7 tooltip" title="Nel titolo il testo toltip"></a>
                        </div>
                    </div>
                    <!-- contenuto -->
                    <div class="well-schedule">
                        <div class="schedule-head">
                            <div class="schedule-head-name">
                                shedule name
                            </div>
                            <div class="schedule-head-status">
                                status
                            </div>
                            <div class="schedule-head-next">
                                next sending
                            </div>
                            <div class="schedule-head-last">
                                last sending
                            </div>
                            <div class="schedule-head-ico">
                            </div>
                        </div>

                        <asp:ListView runat="server" ID="ListTask" ClientIDMode="Predictable">

                            <ItemTemplate>

                                <div class="schedule-row">
                                    <div class="schedule-row-name">
                                        <%# eval("description") %>
                                    </div>
                                    <div class="schedule-row-status">
                                        <div class="schedule-row-status-completed">
                                            <asp:Label runat="server" ID="LblStatus" Font-Bold="true"></asp:Label>
                                        </div>
                                    </div>
                                    <div class="schedule-row-next">
                                        <div class="schedule-row-next-data"><%# CurrAccount.Print.DateTimeLong(Eval("next_send_date"))%></div>
                                        <div class="schedule-row-next-body">
                                            <%# MyUI.Print .Post (eval("next_send_post")) %>
                                        </div>
                                    </div>
                                    <div class="schedule-row-last">
                                        <div class="schedule-row-last-data"><%# CurrAccount.Print.DateTimeLong(Eval("last_send_date"))%></div>
                                        <div class="schedule-row-next-body">
                                            <%# CurrAccount.Print.Post(Eval("last_send_post"))%>
                                        </div>
                                    </div>
                                    <div class="schedule-row-ico">
                                        <div class="schedule-matita">
                                            <asp:LinkButton runat="server" CommandName="EDIT_ROW" CssClass="a-icona-matita"></asp:LinkButton>
                                        </div>
                                        <div class="schedule-chiudi">
                                            <asp:Button runat="server" CommandName="DELETE_ROW" OnClientClick="return openconfirm(this);" CssClass="a-icona-chiudi"></asp:Button>
                                        </div>
                                        <div class="schedule-freccia">
                                            <a class="a-icona-freccia-p" href="#"></a>
                                        </div>
                                    </div>
                                </div>
                            </ItemTemplate>
                        </asp:ListView>

                    </div>
                    <div class="schedule-footer">
                        <App:DataPager runat="server" Controlid="ListTask" PageSize="15" OnPageChanged="SetListTask" />
                    </div>
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>

    <!-- next post -->
    <div class="row-fluid">
        <asp:UpdatePanel ID="UpPNextPost" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <!-- task list -->
                <div class="schedule">
                    <!-- titolo -->
                    <div class="top-bar">
                        Next Post
                        <div>
                            <a href="#" class="a-icona7 tooltip" title="Nel titolo il testo toltip"></a>
                        </div>
                    </div>
                    <!-- contenuto -->
                    <div class="well-schedule">
                        <div class="schedule-head">
                            <div class="schedule-head-name">
                                shedule name
                            </div>
                            <div class="schedule-head-status">
                                status
                            </div>
                            <div class="schedule-head-next">
                                next data
                            </div>
                            <div class="schedule-head-last">
                                next post
                            </div>
                            <div class="schedule-head-ico">
                            </div>
                        </div>

                        <asp:ListView runat="server" ID="ListNextPost" ClientIDMode="Predictable">

                            <ItemTemplate>

                                <div class="schedule-row">
                                    <div class="schedule-row-name">
                                        <%# eval("description") %>
                                    </div>
                                    <div class="schedule-row-status">
                                        <div class="schedule-row-status-completed">
                                            <asp:Label runat="server" ID="LblStatus" Font-Bold="true"></asp:Label>
                                        </div>
                                    </div>
                                    <div class="schedule-row-next">
                                        <div class="schedule-row-next-data"><%# CurrAccount.Print.DateTimeLong(DBase.Conv.DateFromDB(Eval("next_date")))%></div>
                                    </div>
                                    <div class="schedule-row-last">
                                        <div class="schedule-row-next-body">
                                            <%# CurrAccount.Print.Post(Eval("next_send_post"))%>
                                        </div>
                                    </div>
                                </div>
                            </ItemTemplate>
                        </asp:ListView>

                    </div>
                    <div class="schedule-footer">
                        <App:DataPager ID="DataPager1" runat="server" Controlid="ListTask" PageSize="15" OnPageChanged="SetListTask" />
                    </div>
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>

</asp:Content>
